import Vue from 'vue'
import Router from 'vue-router'
import Recommend from '../components/home/Recommend/Recommend.vue'
import About from '../components/home/About/About.vue'
import Home from '../components/home/home.vue'
import Gourment from '../components/home/Gourmet/Gourmet.vue'
import Fransnana from '../components/home/Fransnana/Fransnana.vue'
import ShortProduct from '../components/shortProduct/shortProduct.vue'
import Classif from '../components/classif/Classif.vue'
import Tjian from '../components/classif/Tjian/Tjian.vue'
import Face from '../components/classif/Face/Face.vue'
import Mup from '../components/classif/Mup/Mup.vue'
import ProductDetail from '../components/shortProduct/productDetail.vue'
import Nursing from '../components/classif/Nursing/Nursing.vue'
import Meir from '../components/classif/Meir/Meir.vue'
import Shyp from '../components/classif/Shyp/Shyp.vue'
import Grhl from '../components/classif/Grhl/Grhl.vue'
import Bjys from '../components/classif/Bjys/Bjys.vue'
import Fashion from '../components/classif/Fashion/Fashion.vue'
import Baby from '../components/classif/Baby/Baby.vue'
import Nursi from '../components/classif/Face/Nursi.vue'
import Snaks from '../components/classif/Snaks/Snaks.vue'
import SouSuo from '../components/home/SouSuo/SouSuo.vue'
import Success from '../components/home/SouSuo/Success.vue'
import VueRouter from 'vue-router'
import ProductBrand from '../components/shortProduct/productBrand.vue'
import Message from '../components/home/Message/Message.vue'
import AllTips from '../components/shortProduct/allTips.vue'
import Tips from '../components/shortProduct/tips.vue'
import PritImg from '../components/shortProduct/pritImg.vue'
import MustBuy from '../components/home/About/MustBuy.vue'
import ShopCar from '../components/shopCar/shopCar.vue'
import NewProduct from '../components/home/Message/NewProduct.vue'
import Product from '../components/home/Product/Product.vue'
import ImgTp from '../components/home/Product/ImgTp.vue'
import Prompt from '../components/home/Prompt/Prompt.vue'
import Practice from '../components/home/About/Practice.vue'
import Nymph from '../components/home/About/Nymph.vue'

import Geren from '../components/Body/geren.vue'
import Fanjin from '../components/Body/gerenclass/fanjin.vue'
import Ganzhu from '../components/Body/gerenclass/guanzhuGZH.vue'
import Myxinde from '../components/Body/gerenclass/myxinde.vue'
import Nicheng from '../components/Body/gerenclass/nicheng.vue'
import Shezhi from '../components/Body/gerenclass/shezhi.vue'
import Shoujihao from '../components/Body/gerenclass/shoujihao.vue'
import Xieyi from '../components/Body/gerenclass/xieyi.vue'
import Xiugaimima from '../components/Body/gerenclass/xiugaimima.vue'
import Zhanghu from '../components/Body/gerenclass/zhanghu.vue'
import Zhanghuguanli from '../components/Body/gerenclass/zhanghuguanli.vue'

Vue.use(Router)
Vue.use(VueRouter)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home/recommend'
    },
    {
      path: '/home',
      redirect: '/home/recommend'
    },
    {
      path: '/mustbuy',
      component: MustBuy,
      name: 'mustbuy'
    },
    //修炼秘籍
    {
      path: '/practice',
      component: Practice,
      name: 'practice'
    },
    //女神的蜕变
    {
      path: 'nymph',
      component: Nymph,
      name: 'nymph'
    },
    //  限时断货
    {
      path: '/prompt',
      component: Prompt,
      name: 'prompt'
    },
    // 商品详情
    {
      path: '/product/:productImg/:productPrice/:isPrice/:isTxt/:wid',
      component: Product,
      name: 'product'
    },
    // 图文详情
    {
      path: '/imgTop/:hou?',
      component: ImgTp,
      name: 'imgTop'
    },
    // 搜索页面
    {
      path: '/home/sousuo',
      component: SouSuo,
      name: 'home/sousuo',
      children: [
        {
          path: '/home/sousuo/success',
          component: Success,
          name: 'home/sousuo/success'
        },
      ]
    },
    //消息页面
    {
      path: '/message',
      component: Message,
      name: 'message'
    },
    //本周新品
    {
      path: '/newproduct',
      component: NewProduct,
      name: 'newproduct'
    },
    // 首页
    {
      path: '/home',
      component: Home,
      name: 'home',
      children: [
        //推荐页面
        {
          path: '/home/recommend',
          component: Recommend,
          name: 'home/recommend'
        },
        //贼惦记页面
        {
          path: '/home/about',
          component: About,
          name: 'home/about'
        },
      //  美食页面
        {
          path: '/home/gourmet',
          component: Gourment,
          name: 'home/gourmet'
        },
      //  母婴页面
        {
          path: '/home/fransnana',
          component: Fransnana,
          name: 'home/fransnana'
        }
      ]
    },
  //  分类
    {
      path: '/classif',
      component: Classif,
      name: 'classif',
      children:[
        //  为你推荐
        {
          path: '/classif/tjian',
          component: Tjian,
          name: 'classif/tjian'
        },
        //  面部护理
        {
          path: '/classif/face',
          component: Face,
          name: 'classif/face',
        },

        //  底妆彩妆
        {
          path: '/classif/mup',
          component: Mup,
          name: 'classif/mup'
        },
        //  休闲零食
        {
          path: '/classif/snaks',
          component: Snaks,
          name: 'classif/snaks'
        },
        //  身体护理
        {
          path: '/classif/nursing',
          component: Nursing,
          name: 'classif/nursing'
        },
        //  美容美发
        {
          path: '/classif/meir',
          component: Meir,
          name: 'classif/meir'
        },
        //  生活用品
        {
          path: '/classif/shyp',
          component: Shyp,
          name: 'classif/shyp'
        },
        //  个人护理
        {
          path: '/classif/grhl',
          component: Grhl,
          name: 'classif/grhl'
        },
        //  保健养生
        {
          path: '/classif/bjys',
          component: Bjys,
          name: 'classif/bjys'
        },
        //  时尚潮品
        {
          path: '/classif/fashion',
          component: Fashion,
          name: 'classif/fashion'
        },
        //  母婴用品
        {
          path: '/classif/baby',
          component: Baby,
          name: 'classif/baby'
        }
      ]
    },
    {
      path: '/classif/face/nursi',
      component: Nursi,
      name: 'classif/face/nursi'
    },
  //  断货王
    {
      path: '/shortProduct',
      component: ShortProduct,
      name: 'shortProduct'
    },
    //断货王 商品
    {
      path:'/productDetail/:id/:isPrice',
      component: ProductDetail,
      name: 'productDetail'
    },
    // 断货王 品牌中心
    {
      path: '/productBrand/:brandName',
      component: ProductBrand,
      name: 'productBrand'
    },
    // 断货王 全部心得
    {
      path:'/allTips',
      component: AllTips,
      name: 'allTips',
      redirect: '/allTips/pritImg',
      children: [{
        path: '/allTips/tips',
        component: Tips,
        name: 'allTips/tips'
      },{
        path:'/allTips/pritImg',
        component:PritImg,
        name:'allTips/pritImg'
      }]
    },
  //  购物车
    {
      path:'/shopCar/wid?',
      component: ShopCar,
      name: 'shopCar'
    },
  //  个人中心
//  个人中心
    {
      path: '/geren', //个人中心
      name: 'geren',
      component: Geren
    },
    {
      path: '/guanzhu', //关注公众号
      name: 'guanzhu',
      component: Ganzhu
    },
    {
      path: '/myxinde', //我的心得
      name: 'myxinde',
      component: Myxinde
    },
    {
      path: '/fanjin', //返金排行榜
      name: 'fanjin',
      component: Fanjin
    },
    {
      path: '/zhanghu', //账户
      name: 'zhanghu',
      component: Zhanghu
    },
    {
      path: '/shezhi', //设置
      name: 'shezhi',
      component: Shezhi
    },
    {
      path: '/zhanghuguanli', //账户管理
      name: 'zhanghuguanli',
      component: Zhanghuguanli
    },
    {
      path: '/nicheng', //修改昵称
      name: 'nicheng',
      component: Nicheng
    },
    {
      path: '/shoujihao', //修改手机
      name: 'shoujihao',
      component: Shoujihao
    },
    {
      path: '/xiugaimima', //修改密码
      name: 'xiugaimima',
      component: Xiugaimima
    },
    {
      path: '/xieyi', //协议
      name: 'xieyi',
      component: Xieyi
    },
  ],
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }

});
